package com.bright.cwduijie.duijie.repository;

import com.bright.cwduijie.duijie.pojo.po.DayBooks;
import com.bright.cwduijie.duijie.pojo.po.FixedAssets;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

public interface DayBooksRepository extends JpaRepository<DayBooks, Integer>, JpaSpecificationExecutor<DayBooks> {

    @Query("select TYSHXYDM from DayBooks where sjjhbz=:sjjhbz group by TYSHXYDM")
    List<String> getDistinctTYSHXYDMBySjjhbz(@Param("sjjhbz") int sjjhbz);

    @Query("from DayBooks where sjjhbz=:sjjhbz and DATA_KEY like :ztDataKey% and opType=:opType")
    List<DayBooks> getAllByZtDataKeyAndSjjhbz(@Param("ztDataKey") String ztDataKey, @Param("sjjhbz") int sjjhbz, @Param("opType") int opType);

}